package cn.cihon.ubi.qorosauto.storm;

import java.util.Map;

import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;

public class RawDataStorageBolt extends BaseRichBolt{

	/**
	 * 本类用于存储从Spout传来的二进制数据
	 */
	private static final long serialVersionUID = 1L;
	public OutputCollector collerctor;
	
	@Override
	public void prepare(Map stormConf, TopologyContext context,
			OutputCollector collector) {
		// TODO Auto-generated method stub
		this.collerctor = collector;
	}

	@Override
	public void execute(Tuple input) {
		// TODO Auto-generated method stub
		byte[] buffer = new byte[1024];
		buffer = input.getBinary(0);
	}

	@Override
	public void declareOutputFields(OutputFieldsDeclarer declarer) {
		// TODO Auto-generated method stub
		declarer.declare(new Fields("rawdatastorage"));
	}

}
